import Vue from 'vue'
import Vuex from 'vuex'
// import axios from 'axios'
import user from './user/index.js'
Vue.use(Vuex)

let store = new Vuex.Store({
  modules: {
    user
  },
  state: {
    device: {
      width: 0
    }
  },
  getters: {
    deviceWidth (state) {
      return state.device.width
    }
  },
  mutations: {
    updateDeviceWidth (state, val) {
      console.log(val, 'mutations : updateDeviceWidth')
      state.device.width = val
    }
  }
})
export default store
